Skip to main content
POST
/
v1
/
subscriptions
/
templates
/
{id}
/
configurations
Create subscription template configuration
curl --request POST \
  --url https://api.hyperline.co/v1/subscriptions/templates/{id}/configurations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "currency": "EUR",
  "country": null,
  "phases": [
    {
      "activation_strategy": "manual",
      "end_strategy": "duration",
      "billing_date_setting": "phase_start",
      "products": [
        {
          "id": "itm_FJKlqUb8COXw55",
          "name": "Product name",
          "description": "A description of the product.",
          "description_display_interval_dates": false,
          "payment_interval": {
            "period": "once"
          },
          "payment_schedule": "start",
          "price": {
            "type": "fee",
            "amount": 200
          },
          "prices": [
            {
              "type": "volume",
              "from": 0,
              "to": 20,
              "amount": 200,
              "unit_count": 1,
              "on_tier_incomplete": null
            },
            {
              "type": "volume",
              "from": 20,
              "to": null,
              "amount": 150,
              "unit_count": 1,
              "on_tier_incomplete": null
            }
          ],
          "count": 2,
          "unit_name": "user",
          "min_committed_count": 2,
          "min_amount": 123,
          "max_amount": 123,
          "bill_usage_difference": false,
          "credits_expiration_in_days": 123,
          "expire_credits_at_end_of_period": false
        }
      ],
      "name": "Name of the subscription phase.",
      "type": "standard",
      "status": "pending",
      "order": 0,
      "duration": {
        "count": 1,
        "period": "years"
      },
      "initial_billing_at": "2024-12-20T16:04:11Z",
      "starts_at": "2024-12-20T16:04:11Z",
      "ends_at": "2024-12-20T16:04:11Z",
      "billing_cycle_alignment": "anniversary",
      "do_not_invoice_phase": false,
      "transition_calculation_method": "prorata",
      "transition_invoicing_schedule": "immediately",
      "coupons": [
        {
          "id": "<string>",
          "duration_count": 123,
          "expires_at": "2024-12-20T16:04:11Z",
          "apply_at": "2024-12-20T16:04:11Z",
          "product_ids": [
            "<string>"
          ]
        }
      ]
    }
  ],
  "name": "<string>",
  "minimum_invoice_fee": 250,
  "cancel_at": "2024-12-20T16:04:11Z",
  "custom_properties": {},
  "generate_document": true,
  "document_name": "<string>",
  "add_tax_to_document": true,
  "generate_draft_invoices": true
}
'
{
  "id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.hyperline.co/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json
currency
enum<string>
required

Subscription template currency.

Available options:
EUR,
AED,
AFN,
XCD,
ALL,
AMD,
AOA,
ARS,
USD,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
XOF,
BMD,
BND,
BOB,
BRL,
BSD,
BTN,
NOK,
BWP,
BYR,
BZD,
CAD,
CDF,
XAF,
CHF,
NZD,
CLP,
CNY,
COP,
CRC,
CUP,
CVE,
ANG,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
MAD,
ERN,
ETB,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
XPF,
NGN,
NIO,
NPR,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
SSP,
STD,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
UYU,
UZS,
VEF,
VND,
VUV,
WST,
YER,
ZAR,
ZMW,
ZWL
Example:

"EUR"

country
enum<string> | null
required

Subscription template country.

Available options:
AD,
AE,
AF,
AG,
AI,
AL,
AM,
AO,
AQ,
AR,
AS,
AT,
A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

minimum_invoice_fee
number | null

Minimum fee applied to each invoice outside of one time payments.

Example:

250

cancel_at
string<date-time>

Subscription cancel date. UTC date time string in the ISO 8601 format.

Example:

"2024-12-20T16:04:11Z"

cancellation_strategy
enum<string>

Strategy used to cancel the subscription. If not specified do_nothing is used.

  • charge_prorata: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
  • charge_custom: Will charge the customer a custom amount.
  • refund_prorata: Will refund to the customer the overpaid subscription amount using prorated calculations on the cancellation date.
  • refund_custom: Will refund to the customer a custom amount.
  • end_of_period: Will cancel the subscription at the end date of the current billing period.
  • do_nothing: Will only cease the subscription without any additional actions.
Available options:
refund_prorata,
refund_custom,
charge_prorata,
charge_custom,
end_of_period,
do_nothing
custom_properties
object

A list of key value with the slug of the custom property as the key and the custom property value as value.

generate_document

Generate non-legal documents instead of invoices.

document_name
string | null

If generate_document is turned on, allows you to give a name to your document.

add_tax_to_document

If generate_document is turned on, will add taxes to document.

generate_draft_invoices

Generate draft invoices for the subscription. Each invoice will need to be reviewed and validated manually before being sent

contract_terms
object

Contract terms linked to the subscription.

Response

201 - application/json
id
string
required